package BeenChina.PM.Service.Impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import BeenChina.PM.DAO.CalculateDao;
import BeenChina.PM.DAO.CaseCostDao;
import BeenChina.PM.DAO.CaseProductionInfoDao;
import BeenChina.PM.DAO.EmpAdjustBaseInfoDao;
import BeenChina.PM.DAO.QualityCheckDao;
import BeenChina.PM.DAO.UtilizationDao;
import BeenChina.PM.Model.ModelCalculateBaseInfo;
import BeenChina.PM.Model.ModelCalculateCaseInfo;
import BeenChina.PM.Model.ModelCalculateEmpCalculateInfo;
import BeenChina.PM.Model.ModelCaseCostBasicInfo;
import BeenChina.PM.Model.ModelCaseCostCaseInfo;
import BeenChina.PM.Model.ModelCaseCostCostInfo;
import BeenChina.PM.Model.ModelCaseCostExchangeRateInfo;
import BeenChina.PM.Model.ModelCaseCostGeneralSurvey;
import BeenChina.PM.Model.ModelCaseNumberEfficiency;
import BeenChina.PM.Model.ModelDayREntryTime;
import BeenChina.PM.Model.ModelDayRUtilization;
import BeenChina.PM.Model.ModelEmpAdjustBaseInfo;
import BeenChina.PM.Model.ModelQualityCheckBaseInfo;
import BeenChina.PM.Model.ModelQualityCheckBaseView;
import BeenChina.PM.Model.ModelQualityCheckMissTypeInfo;
import BeenChina.PM.Model.ModelQualityCheckMissTypeView;
import BeenChina.PM.Model.ModelTimeREntryTime;
import BeenChina.PM.Model.ModelTimeRUtilization;
import BeenChina.PM.Model.ModelWeekREntryTime;
import BeenChina.PM.Model.ModelWeekRUtilization;
import BeenChina.PM.Service.CaseProductionInfoService;

public class CaseProductionInfoServiceImpl implements CaseProductionInfoService {

	  	private CaseProductionInfoDao caseProductionInfoDao;
	  	private UtilizationDao utilizationDao;
	  	private CalculateDao calculateDao;
	  	private CaseCostDao caseCostDao;
	  	private QualityCheckDao qualityCheckDao;
	  	private EmpAdjustBaseInfoDao empAdjustBaseInfoDao;

	   
	    public void setEmpAdjustBaseInfoDao(EmpAdjustBaseInfoDao empAdjustBaseInfoDao) {
			this.empAdjustBaseInfoDao = empAdjustBaseInfoDao;
		}


		public void setQualityCheckDao(QualityCheckDao qualityCheckDao) {
			this.qualityCheckDao = qualityCheckDao;
		}


		public void setCaseCostDao(CaseCostDao caseCostDao) {
			this.caseCostDao = caseCostDao;
		}


		public void setCaseProductionInfoDao(CaseProductionInfoDao dao) {
	        this.caseProductionInfoDao = dao;
	    }
		

		public void setUtilizationDao(UtilizationDao utilizationDao) {
			this.utilizationDao = utilizationDao;
		}
		 

		public void setCalculateDao(CalculateDao calculateDao) {
			this.calculateDao = calculateDao;
		}

		
	    public List<ModelCaseNumberEfficiency> selectCaseNumberEfficiency( String dateFrom,String dateTo){   
			try{			 
				Map<String, String> params = new HashMap<String, String>();
 		
				params.put("dateFrom", dateFrom);
				params.put("dateTo", dateTo); 

				return this.caseProductionInfoDao.selectCaseNumberEfficiency(params);
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }  
	    }

		@Override
		public List<ModelDayRUtilization> selectDayRUtilization(
				String dateFrom, String dateTo) {
			try{			 
				Map<String, String> params = new HashMap<String, String>();
			 			
				params.put("dateFrom", dateFrom);
				params.put("dateTo", dateTo); 

				return this.utilizationDao.selectDayRUtilization(params);
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }  
		}
		
		@Override
		public List<ModelDayREntryTime> selectDayREntryTime(String dateFrom,
				String dateTo) {
			try{			 
				Map<String, String> params = new HashMap<String, String>();
			 			
				params.put("dateFrom", dateFrom);
				params.put("dateTo", dateTo); 

				return this.utilizationDao.selectDayREntryTime(params);
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }  
		}	 
		

		@Override
		public List<ModelTimeRUtilization> selectTimeRUtilization(String date) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("startTime", date); 
				return this.utilizationDao.selectTimeRUtilization(params);
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }   
		}

		@Override
		public List<ModelTimeREntryTime> selectTimeREntryTime(String date) {
			// TODO Auto-generated method stub
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("startTime", date); 
				return this.utilizationDao.selectTimeREntryTime(params);
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }   
		}

		@Override
		public List<ModelWeekRUtilization> selectWeekRUtilization(
				String dateFrom, String dateTo, String week) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("dateFrom", dateFrom); 
				params.put("dateTo", dateTo);
				params.put("week", week);
				return this.utilizationDao.selectWeekRUtilization(params);
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }   
		}

		@Override
		public List<ModelWeekREntryTime> selectWeekREntryTime(String dateFrom,
				String dateTo, String week) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("dateFrom", dateFrom); 
				params.put("dateTo", dateTo);
				params.put("week", week);
				return this.utilizationDao.selectWeekREntryTime(params);
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }   
		}

		@Override
		public  List<ModelCalculateBaseInfo> selectCalculateBaseInfo(
				String yearMonth) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("yearMonth", yearMonth); 
			 
				return this.calculateDao.selectCalculateBaseInfo(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }   
		}

		@Override
		public List<ModelCalculateEmpCalculateInfo> selectCalculateEmpCalculateInfo(
				String yearMonth) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("yearMonth", yearMonth); 
			 
				return this.calculateDao.selectCalculateEmpCalculateInfo(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }   
		}

		@Override
		public List<ModelCalculateCaseInfo> selectCalculateCaseInfo(
				String yearMonth, String categoryName) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("yearMonth", yearMonth); 
				params.put("categoryName", categoryName); 
				return this.calculateDao.selectCalculateCaseInfo(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }   
		}


		@Override
		public List<ModelCaseCostGeneralSurvey> selectCaseCostGeneralSurvey(
				String dateFrom, String dateTo,String moneyType) {
			 
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("dateFrom", dateFrom); 
				params.put("dateTo", dateTo);
				params.put("moneyType", moneyType);	
				
				return this.caseCostDao.selectCaseCostGeneralSurvey(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }
		}


		@Override
		public List<ModelCaseCostBasicInfo> selectCaseCostBasicInfo(
				String dateFrom, String dateTo,String moneyType) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("dateFrom", dateFrom); 
				params.put("dateTo", dateTo);
				params.put("moneyType", moneyType);	
				
				return this.caseCostDao.selectCaseCostBasicInfo(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }
		}


		@Override
		public List<ModelCaseCostCaseInfo> selectCaseCostCaseInfo(
				String dateFrom, String dateTo, String caseName,String moneyType) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("dateFrom", dateFrom); 
				params.put("dateTo", dateTo);	 
				params.put("caseName", caseName);
				params.put("moneyType", moneyType);	
				
				return this.caseCostDao.selectCaseCostCaseInfo(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }
		}


		@Override
		public List<ModelCaseCostCostInfo> selectCaseCostCostInfo(
				String dateFrom, String dateTo, String caseName,String moneyType) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("dateFrom", dateFrom); 
				params.put("dateTo", dateTo);	 
				params.put("caseName", caseName);
				params.put("moneyType", moneyType);	
				
				return this.caseCostDao.selectCaseCostCostInfo(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }
		}


		@Override
		public List<ModelCaseCostExchangeRateInfo> selectCaseCostExchangeRateInfo(
				String dateFrom, String dateTo,String moneyType) {
 
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("dateFrom", dateFrom); 
				params.put("dateTo", dateTo);
				params.put("moneyType", moneyType);	 
			 
				return this.caseCostDao.selectCaseCostExchangeRateInfo(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }
		}


		@Override
		public List<ModelQualityCheckBaseInfo> selectQualityCheckBaseInfo(
				String date, String dataType) {
			 
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("date", date); 
				params.put("dataType", dataType);	 
			 
				return this.qualityCheckDao.selectQualityCheckBaseInfo(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }
		}


		@Override
		public List<ModelQualityCheckMissTypeInfo> selectQualityCheckMissTypeInfo(
				String date, String dataType) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("date", date); 
				params.put("dataType", dataType);	 
			 
				return this.qualityCheckDao.selectQualityCheckMissTypeInfo(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }
		}


		@Override
		public List<ModelQualityCheckBaseView> selectQualityCheckBaseView(
				String date, String dataType, String caseName) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("date", date); 
				params.put("dataType", dataType);	 
				params.put("caseName", caseName);	 
				
				return this.qualityCheckDao.selectQualityCheckBaseView(params);
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }
		}


		@Override
		public List<ModelQualityCheckMissTypeView> selectQualityCheckMissTypeView(
				String date, String dataType) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("date", date); 
				params.put("dataType", dataType);	 
			 
				return this.qualityCheckDao.selectQualityCheckMissTypeView(params);
						 
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }
		}


		@Override
		public List<ModelEmpAdjustBaseInfo> selectEmpAdjustBaseInfo(
				String dateFrom, String dateTo) {
			try{			 
				Map<String, String> params = new HashMap<String, String>(); 
				params.put("dateFrom", dateFrom); 
				params.put("dateTo", dateTo);	 
			 
				return this.empAdjustBaseInfoDao.selectEmpAdjustBaseInfo(params);						 
				
			 } catch (Exception e) {  
	             e.printStackTrace();  
	             return null;
	         }
		}
 

		   
	    
}
